package Practice05.test2;

public class Line {
    private double k;//斜率
    private double lenth;
    Point point1;
    Point point2;

    public Line(Point point1, Point point2) {
        this.point1 = point1;
        this.point2 = point2;
    }

    public double getK() {

        return (point1.getY()- point2.getY())/(point1.getX()- point2.getX());
    }

    public void setK(int k) {
        this.k = k;
    }

    public double getLenth() {

        return Math.sqrt(Math.pow(point1.getY()-point2.getY(),2)+Math.pow(point1.getX()- point2.getX(),2));
    }

    public void setLenth(int lenth) {
        this.lenth = lenth;
    }
}
